<template>
    <uni-popup ref="fastPicker" type="bottom">
        <div class="fast_pick_list">
            <div class="title">{{title}}</div>
            <p v-for="(item, index) in list" :key="index" @click="fastPick(item)">{{item.name}}</p>
        </div>
    </uni-popup>
</template>

<script>
export default {
    data() {
        return {
            promiseResolve: null, 
            title: '',
            list: []
        }
    },
    mounted() {

    },
    methods: {
        pick(params) {
            return new Promise((resolve, reject) => {
                this.title = params.title
                this.list = params.options
                this.promiseResolve = resolve
                this.$refs.fastPicker.open()
            })
        },
        fastPick(item) {
            this.promiseResolve(item)
            this.$refs.fastPicker.close()
        }
    }

}
</script>

<style lang="less" scoped>
.fast_pick_list{
    background: #fff;
    padding-bottom: 20rpx;
    border-radius: 30rpx 30rpx 0 0;
    .title{
        width: 100%;
        text-align: center;
        line-height: 80rpx;
        font-weight: bold;
        font-size: 34rpx;
        color: #666;
    }
    p{
        line-height: 100rpx;
        text-align: center;
        border-top: 1rpx solid #eee;
        color: #000;
    }
}
</style>